<template>
  <div class="wty-shop-header">
    <div class="wty-shop-header-logo">
      <router-link class="wty-logo-img" to="/take">
        <img
          src="https://waimai.meituan.com/static/img/new2018/header-logo-black.png"
          alt
        />
      </router-link>
    </div>
    <div class="wty-shop-header-nav">
      <ul class="wty-shop-header-nav-ul">
        <li class="wty-shop-header-nav-ul-li" v-for="(link, index) in headerNav" :key="index">
          <router-link :class="{ active: needNavShowIndex === index }" to>{{
            link
          }}</router-link>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      headerNav: [
        "首页",
        "入住加盟",
        "开放平台",
        "社会责任",
        "点外卖",
        "下载手机版"
      ],
      navShowIndex: 4
    };
  },
  computed: {
    needNavShowIndex() {
      return this.navShowIndex;
    }
  }
};
</script>
<style lang="stylus" scoped>
.wty-shop-header {
  margin: 0 auto;
  width: 61.875rem;
  height: 100%;
  background-color: #FFFFFF;

  .wty-shop-header-logo {
    float: left;
    height: 4.375rem;
    font-size: 0;

    .wty-logo-img {
      display: inline-block;
      width: 10.1875rem;
      height: 3rem;
      margin-top: 0.6875rem;

      img {
        width: 10.1875rem;
        height: 3rem;
      }
    }
  }

  .wty-shop-header-nav {
    float: right;
    height: 4.375rem;

    .wty-shop-header-nav-ul {
      height: 4.375rem;
      line-height: 4.375rem;

      .wty-shop-header-nav-ul-li {
        float: left;
        margin: 0 1.25rem;
        height: 4.375rem;

        a {
          display: inline-block;
          height: 4.375rem;
          box-sizing: border-box;
          line-height: 4.375rem;
          color: #222222;
          font-size: 16px;

          &.active {
            font-weight: 700;
            border-bottom: 3px solid #FFBD27;
          }

          &:hover {
            font-weight: 700;
            border-bottom: 0.1875rem solid #FFBD27;
          }
        }
      }
    }
  }
}
</style>
